package com.bdqn.util;

/**
 * 存放错误信息的枚举类
 */
public enum ResultEnum {
    PHONE_ISNULL(10099,"手机号不能为空"),
    REPEAT_PARAM(10088,"唯一的字段参数重复"),
    NOT_NAME(10086,"用户名已存在"),
    SUCCESS(200, "成功"),
    FAIL(0,"失败"),
    ADD_FAIL(01,"添加失败"),
    COMMON_EXCEPTION(500, "系统异常"),
    // 权限校验
    AUTH_USER_NOT_LOGIN(401, "未登录！"),
    // 参数校验
    FAIL_PARAM_EMPTY(0, "必传参数未传！"),

    // Ums相关
    FAIL_UMS_PHONE_ERROR(10001, "手机号错误"),
    FAIL_UMS_SMS_CODE_TYPE_ERROR(10002, "短信类型错误"),
    FAIL_UMS_SMS_CODE_ERROR(10003, "短信验证码错误或已失效"),
    // Pms相关
    PRODUCT_SPU_EMPTY(20003,"查询不到商品"),
    PRODUCT_STATUS_OFF(20004,"商品已下架"),
    // 商品评论
    PRODUCT_COMMENT_STAR_ERROR(21001,"评分规则错误"),
    PRODUCT_COMMENT_NOT_BUY(21002,"要评论的商品未曾购买"),
    PRODUCT_COMMENT_CONTENT_LENGTH_MAX_ERROR(21001,"评论内容过长字"),

    // 购物车
    ADD_CART_MIN_NUM_ERROR(30001,"至少需要向购物车中加入1件商品"),
    ADD_CART_LOW_STOCK_ERROR(30002,"库存不足"),

    // 订单相关
    ORDER_STATUS_TIMEOUT(40003,"订单已过期"),
    ORDER_NOT_EXIST(40001,"订单不存在"),
    ORDER_STATUS_ERROR(40002,"订单状态错误"),
    RECEIVER_ADDRESS_MAX_ERROR(41001,"最多可以添加20个个人收收货地址"),
    RECEIVER_ADDRESS_NOT_EXIST_ERROR(41004,"当前收货地址不存在"),
    REDUCE_INVENTORY_ERROR(40003,"扣减商品sku库存失败"),
    DELETE_CART_ERROR(40004,"清空购物车失败"),

    // 订单支付
    PAY_ERROR(50001,"支付失败"),

    // 其他
    PARAM_ERROR(91001, "请求参数错误！"),
    OTHER_FILE_SIZE_MAX_ERROR(91002,"上传文件过大"),
    OTHER_FILE_NOT_EMPTY_ERROR(91003,"不能上传空文件");
    Integer code;
    String msg;

    ResultEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }


}
